

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>Host Management &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="Service Management" href="../services/" />
    <link rel="prev" title="现有集群切换到 cephadm" href="../adoption/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../">Cephadm</a></li>
      <li class="breadcrumb-item active">Host Management</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../_sources/cephadm/host-management.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Cephadm</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../compatibility/">Compatibility and Stability</a></li>
<li class="toctree-l2"><a class="reference internal" href="../install/">部署个全新的 Ceph 集群</a></li>
<li class="toctree-l2"><a class="reference internal" href="../adoption/">现有集群切换到 cephadm</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Host Management</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#listing-hosts">Listing Hosts</a></li>
<li class="toctree-l3"><a class="reference internal" href="#adding-hosts">Adding Hosts</a></li>
<li class="toctree-l3"><a class="reference internal" href="#removing-hosts">Removing Hosts</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#offline-host-removal">Offline host removal</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#host-labels">Host labels</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#special-host-labels">Special host labels</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#maintenance-mode">Maintenance Mode</a></li>
<li class="toctree-l3"><a class="reference internal" href="#rescanning-host-devices">Rescanning Host Devices</a></li>
<li class="toctree-l3"><a class="reference internal" href="#creating-many-hosts-at-once">Creating many hosts at once</a></li>
<li class="toctree-l3"><a class="reference internal" href="#setting-the-initial-crush-location-of-host">Setting the initial CRUSH location of host</a></li>
<li class="toctree-l3"><a class="reference internal" href="#removing-a-host-from-the-crush-map">Removing a host from the CRUSH map</a></li>
<li class="toctree-l3"><a class="reference internal" href="#os-tuning-profiles">OS Tuning Profiles</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#viewing-profiles">Viewing Profiles</a></li>
<li class="toctree-l4"><a class="reference internal" href="#removing-profiles">Removing Profiles</a></li>
<li class="toctree-l4"><a class="reference internal" href="#modifying-profiles">Modifying Profiles</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#ssh-configuration">SSH Configuration</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#default-behavior">Default behavior</a></li>
<li class="toctree-l4"><a class="reference internal" href="#configuring-a-different-ssh-user">Configuring a different SSH user</a></li>
<li class="toctree-l4"><a class="reference internal" href="#customizing-the-ssh-configuration">Customizing the SSH configuration</a></li>
<li class="toctree-l4"><a class="reference internal" href="#setting-up-ca-signed-keys-for-the-cluster">Setting up CA signed keys for the cluster</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#fully-qualified-domain-names-vs-bare-host-names">Fully qualified domain names vs bare host names</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../services/">Service Management</a></li>
<li class="toctree-l2"><a class="reference internal" href="../certmgr/">Certificate Management</a></li>
<li class="toctree-l2"><a class="reference internal" href="../upgrade/">升级 Ceph</a></li>
<li class="toctree-l2"><a class="reference internal" href="../operations/">Cephadm operations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../client-setup/">Client Setup</a></li>
<li class="toctree-l2"><a class="reference internal" href="../troubleshooting/">Troubleshooting</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../dev/cephadm/">Cephadm Feature Planning</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="host-management">
<span id="orchestrator-cli-host-management"></span><h1>Host Management<a class="headerlink" href="#host-management" title="Permalink to this heading"></a></h1>
<section id="listing-hosts">
<h2>Listing Hosts<a class="headerlink" href="#listing-hosts" title="Permalink to this heading"></a></h2>
<p>Run a command of this form to list hosts associated with the cluster:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><style type="text/css">
span.prompt1:before {
  content: "# ";
}
</style><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>ls<span class="w"> </span><span class="o">[</span>--format<span class="w"> </span>yaml<span class="o">]</span><span class="w"> </span><span class="o">[</span>--host-pattern<span class="w"> </span>&lt;name&gt;<span class="o">]</span><span class="w"> </span><span class="o">[</span>--label<span class="w"> </span>&lt;label&gt;<span class="o">]</span><span class="w"> </span><span class="o">[</span>--host-status<span class="w"> </span>&lt;status&gt;<span class="o">]</span><span class="w"> </span><span class="o">[</span>--detail<span class="o">]</span></span>
</pre></div></div><p>In commands of this form, the arguments “host-pattern”, “label”, and
“host-status” are optional and are used for filtering.</p>
<ul class="simple">
<li><p>“host-pattern” is a regex that matches against hostnames and returns only
matching hosts.</p></li>
<li><p>“label” returns only hosts with the specified label.</p></li>
<li><p>“host-status” returns only hosts with the specified status (currently
“offline” or “maintenance”).</p></li>
<li><p>Any combination of these filtering flags is valid. It is possible to filter
against name, label and status simultaneously, or to filter against any
proper subset of name, label and status.</p></li>
</ul>
<p>The “detail” parameter provides more host related information for cephadm based
clusters. For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>ls<span class="w"> </span>--detail</span>
</pre></div></div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">HOSTNAME</span>     <span class="n">ADDRESS</span>         <span class="n">LABELS</span>  <span class="n">STATUS</span>  <span class="n">VENDOR</span><span class="o">/</span><span class="n">MODEL</span>                           <span class="n">CPU</span>    <span class="n">HDD</span>      <span class="n">SSD</span>  <span class="n">NIC</span>
<span class="n">ceph</span><span class="o">-</span><span class="n">master</span>  <span class="mf">192.168.122.73</span>  <span class="n">_admin</span>          <span class="n">QEMU</span> <span class="p">(</span><span class="n">Standard</span> <span class="n">PC</span> <span class="p">(</span><span class="n">Q35</span> <span class="o">+</span> <span class="n">ICH9</span><span class="p">,</span> <span class="mi">2009</span><span class="p">))</span>  <span class="mi">4</span><span class="n">C</span><span class="o">/</span><span class="mi">4</span><span class="n">T</span>  <span class="mi">4</span><span class="o">/</span><span class="mf">1.6</span><span class="n">TB</span>  <span class="o">-</span>    <span class="mi">1</span>
<span class="mi">1</span> <span class="n">hosts</span> <span class="ow">in</span> <span class="n">cluster</span>
</pre></div>
</div>
</section>
<section id="adding-hosts">
<span id="cephadm-adding-hosts"></span><h2>Adding Hosts<a class="headerlink" href="#adding-hosts" title="Permalink to this heading"></a></h2>
<p>Hosts must have these <a class="reference internal" href="../install/#cephadm-host-requirements"><span class="std std-ref">准备事项</span></a> installed.
Hosts without all the necessary requirements will fail to be added to the cluster.</p>
<p>To add each new host to the cluster, perform two steps:</p>
<ol class="arabic">
<li><p>Install the cluster’s public SSH key in the new host’s root user’s <code class="docutils literal notranslate"><span class="pre">authorized_keys</span></code> file:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ssh-copy-id<span class="w"> </span>-f<span class="w"> </span>-i<span class="w"> </span>/etc/ceph/ceph.pub<span class="w"> </span>root@*&lt;new-host&gt;*</span>
</pre></div></div><p>For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ssh-copy-id<span class="w"> </span>-f<span class="w"> </span>-i<span class="w"> </span>/etc/ceph/ceph.pub<span class="w"> </span>root@host2</span>
<span class="prompt1">ssh-copy-id<span class="w"> </span>-f<span class="w"> </span>-i<span class="w"> </span>/etc/ceph/ceph.pub<span class="w"> </span>root@host3</span>
</pre></div></div></li>
<li><p>Tell Ceph that the new node is part of the cluster:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>add<span class="w"> </span>*&lt;newhost&gt;*<span class="w"> </span><span class="o">[</span>*&lt;ip&gt;*<span class="o">]</span><span class="w"> </span><span class="o">[</span>*&lt;label1&gt;<span class="w"> </span>...*<span class="o">]</span></span>
</pre></div></div><p>For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>add<span class="w"> </span>host2<span class="w"> </span><span class="m">10</span>.10.0.102</span>
<span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>add<span class="w"> </span>host3<span class="w"> </span><span class="m">10</span>.10.0.103</span>
</pre></div></div><p>It is best to explicitly provide the host IP address.  If an address is
not provided, then the host name will be immediately resolved via
DNS and the result will be used.</p>
<p>One or more labels can also be included to immediately label the
new host.  For example, by default the <code class="docutils literal notranslate"><span class="pre">_admin</span></code> label will make
cephadm maintain a copy of the <code class="docutils literal notranslate"><span class="pre">ceph.conf</span></code> file and a
<code class="docutils literal notranslate"><span class="pre">client.admin</span></code> keyring file in <code class="docutils literal notranslate"><span class="pre">/etc/ceph</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>add<span class="w"> </span>host4<span class="w"> </span><span class="m">10</span>.10.0.104<span class="w"> </span>--labels<span class="w"> </span>_admin</span>
</pre></div></div></li>
</ol>
</section>
<section id="removing-hosts">
<span id="cephadm-removing-hosts"></span><h2>Removing Hosts<a class="headerlink" href="#removing-hosts" title="Permalink to this heading"></a></h2>
<p>A host can safely be removed from the cluster after all daemons are removed
from it.</p>
<p>To drain all daemons from a host, run a command of the following form:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>drain<span class="w"> </span>*&lt;host&gt;*</span>
</pre></div></div><p>The <code class="docutils literal notranslate"><span class="pre">_no_schedule</span></code> and <code class="docutils literal notranslate"><span class="pre">_no_conf_keyring</span></code> labels will be applied to the
host. See <a class="reference internal" href="#cephadm-special-host-labels"><span class="std std-ref">Special host labels</span></a>.</p>
<p>If you want to drain daemons but leave managed <cite>ceph.conf</cite> and keyring
files on the host, you may pass the <code class="docutils literal notranslate"><span class="pre">--keep-conf-keyring</span></code> flag to the
drain command.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>drain<span class="w"> </span>*&lt;host&gt;*<span class="w"> </span>--keep-conf-keyring</span>
</pre></div></div><p>This will apply the <code class="docutils literal notranslate"><span class="pre">_no_schedule</span></code> label to the host but not the
<code class="docutils literal notranslate"><span class="pre">_no_conf_keyring</span></code> label.</p>
<p>All OSDs on the host will be scheduled to be removed. You can check
progress of the OSD removal operation with the following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>osd<span class="w"> </span>rm<span class="w"> </span>status</span>
</pre></div></div><p>See <a class="reference internal" href="../services/osd/#cephadm-osd-removal"><span class="std std-ref">Remove an OSD</span></a> for more details about OSD removal.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">orch</span> <span class="pre">host</span> <span class="pre">drain</span></code> command also supports a <code class="docutils literal notranslate"><span class="pre">--zap-osd-devices</span></code>
flag. Setting this flag while draining a host will cause cephadm to zap
the devices of the OSDs it is removing as part of the drain process</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>drain<span class="w"> </span>*&lt;host&gt;*<span class="w"> </span>--zap-osd-devices</span>
</pre></div></div><p>Use the following command to determine whether any daemons are still on the
host:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>ps<span class="w"> </span>&lt;host&gt;</span>
</pre></div></div><p>After all daemons have been removed from the host, remove the host from the
cluster by running the following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>rm<span class="w"> </span>&lt;host&gt;</span>
</pre></div></div><section id="offline-host-removal">
<h3>Offline host removal<a class="headerlink" href="#offline-host-removal" title="Permalink to this heading"></a></h3>
<p>If a host is offline and can not be recovered, it can be removed from the
cluster by running a command of the following form:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>rm<span class="w"> </span>&lt;host&gt;<span class="w"> </span>--offline<span class="w"> </span>--force</span>
</pre></div></div><div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>This can potentially cause data loss. This command forcefully
purges OSDs from the cluster by calling <code class="docutils literal notranslate"><span class="pre">osd</span> <span class="pre">purge-actual</span></code> for each OSD.
Any service specs that still contain this host should be manually updated.</p>
</div>
</section>
</section>
<section id="host-labels">
<span id="orchestrator-host-labels"></span><h2>Host labels<a class="headerlink" href="#host-labels" title="Permalink to this heading"></a></h2>
<p>The orchestrator supports assigning labels to hosts. Labels
are free form and have no particular meaning by itself and each host
can have multiple labels. They can be used to specify placement
of daemons. See <a class="reference internal" href="../services/#orch-placement-by-labels"><span class="std std-ref">Placement by labels</span></a></p>
<p>Labels can be added when adding a host with the <code class="docutils literal notranslate"><span class="pre">--labels</span></code> flag:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>add<span class="w"> </span>my_hostname<span class="w"> </span>--labels<span class="o">=</span>my_label1</span>
<span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>add<span class="w"> </span>my_hostname<span class="w"> </span>--labels<span class="o">=</span>my_label1,my_label2</span>
</pre></div></div><p>To add a label a existing host, run:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>label<span class="w"> </span>add<span class="w"> </span>my_hostname<span class="w"> </span>my_label</span>
</pre></div></div><p>To remove a label, run:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>label<span class="w"> </span>rm<span class="w"> </span>my_hostname<span class="w"> </span>my_label</span>
</pre></div></div><section id="special-host-labels">
<span id="cephadm-special-host-labels"></span><h3>Special host labels<a class="headerlink" href="#special-host-labels" title="Permalink to this heading"></a></h3>
<p>The following host labels have a special meaning to cephadm.  All start with <code class="docutils literal notranslate"><span class="pre">_</span></code>.</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">_no_schedule</span></code>: <em>Do not schedule or deploy daemons on this host</em>.</p>
<p>This label prevents cephadm from deploying daemons on this host.  If it is added to
an existing host that already contains Ceph daemons, it will cause cephadm to move
those daemons elsewhere (except OSDs, which are not removed automatically).</p>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">_no_conf_keyring</span></code>: <em>Do not deploy config files or keyrings on this host</em>.</p>
<p>This label is effectively the same as <code class="docutils literal notranslate"><span class="pre">_no_schedule</span></code> but instead of working for
daemons it works for client keyrings and ceph conf files that are being managed
by cephadm</p>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">_no_autotune_memory</span></code>: <em>Do not autotune memory on this host</em>.</p>
<p>This label will prevent daemon memory from being tuned even when the
<code class="docutils literal notranslate"><span class="pre">osd_memory_target_autotune</span></code> or similar option is enabled for one or more daemons
on that host.</p>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">_admin</span></code>: <em>Distribute client.admin and ceph.conf to this host</em>.</p>
<p>By default, an <code class="docutils literal notranslate"><span class="pre">_admin</span></code> label is applied to the first host in the cluster (where
bootstrap was originally run), and the <code class="docutils literal notranslate"><span class="pre">client.admin</span></code> key is set to be distributed
to that host via the <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">orch</span> <span class="pre">client-keyring</span> <span class="pre">...</span></code> function.  Adding this label
to additional hosts will normally cause cephadm to deploy config and keyring files
in <code class="docutils literal notranslate"><span class="pre">/etc/ceph</span></code>. Starting from versions 16.2.10 (Pacific) and 17.2.1 (Quincy) in
addition to the default location <code class="docutils literal notranslate"><span class="pre">/etc/ceph/</span></code> cephadm also stores config and keyring
files in the <code class="docutils literal notranslate"><span class="pre">/var/lib/ceph/&lt;fsid&gt;/config</span></code> directory.</p>
</li>
</ul>
</section>
</section>
<section id="maintenance-mode">
<h2>Maintenance Mode<a class="headerlink" href="#maintenance-mode" title="Permalink to this heading"></a></h2>
<p>Place a host in and out of maintenance mode (stops all Ceph daemons on host):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>maintenance<span class="w"> </span>enter<span class="w"> </span>&lt;hostname&gt;<span class="w"> </span><span class="o">[</span>--force<span class="o">]</span><span class="w"> </span><span class="o">[</span>--yes-i-really-mean-it<span class="o">]</span></span>
<span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>maintenance<span class="w"> </span><span class="nb">exit</span><span class="w"> </span>&lt;hostname&gt;<span class="w"> </span><span class="o">[</span>--force<span class="o">]</span><span class="w"> </span><span class="o">[</span>--offline<span class="o">]</span></span>
</pre></div></div><p>The <code class="docutils literal notranslate"><span class="pre">--force</span></code> flag on the <code class="docutils literal notranslate"><span class="pre">enter</span></code> command allows the user to bypass warnings (but not alerts).
The <code class="docutils literal notranslate"><span class="pre">--yes-i-really-mean-it</span></code> flag bypasses all safety checks and will attempt to force the
host into maintenance mode no matter what. The <code class="docutils literal notranslate"><span class="pre">--force</span></code> and <code class="docutils literal notranslate"><span class="pre">--offline</span></code> flags to the <code class="docutils literal notranslate"><span class="pre">exit</span></code> command
can be used to to have cephadm mark a host that is in maintenance mode and offline as no longer
in maintenance mode. Note in this case if the host comes online, the Ceph daemons
on the host will remain in the stopped state. The <code class="docutils literal notranslate"><span class="pre">--force</span></code> and <code class="docutils literal notranslate"><span class="pre">--offline</span></code> flags to the <code class="docutils literal notranslate"><span class="pre">exit</span></code>
command are intended to be run for hosts in maintenance mode that are permanently offline
before removing the host entirely from cephadm management using the <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">orch</span> <span class="pre">host</span> <span class="pre">rm</span></code> command.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Using the --yes-i-really-mean-it flag to force the host to enter maintenance
mode can potentially cause loss of data availability, the mon quorum to break down due
to too few running monitors, mgr module commands (such as <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">orch</span> <span class="pre">.</span> <span class="pre">.</span> <span class="pre">.</span></code> commands)
to be become unresponsive, and a number of other possible issues. Please only use this
flag if you’re absolutely certain you know what you’re doing.</p>
</div>
<p>See also <a class="reference internal" href="#cephadm-fqdn"><span class="std std-ref">Fully qualified domain names vs bare host names</span></a></p>
</section>
<section id="rescanning-host-devices">
<h2>Rescanning Host Devices<a class="headerlink" href="#rescanning-host-devices" title="Permalink to this heading"></a></h2>
<p>Some servers and external enclosures may not register device removal or insertion with the
kernel. In these scenarios, you’ll need to perform a device rescan on the appropriate host.
A rescan is typically non-disruptive, and can be performed with the following CLI command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>rescan<span class="w"> </span>&lt;hostname&gt;<span class="w"> </span><span class="o">[</span>--with-summary<span class="o">]</span></span>
</pre></div></div><p>The <code class="docutils literal notranslate"><span class="pre">with-summary</span></code> flag provides a breakdown of the number of HBAs found and scanned, together
with any that failed:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><style type="text/css">
span.prompt2:before {
  content: "[ceph:root@rh9-ceph1/]# ";
}
</style><span class="prompt2">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>rescan<span class="w"> </span>rh9-ceph1<span class="w"> </span>--with-summary</span>
</pre></div></div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Ok</span><span class="o">.</span> <span class="mi">2</span> <span class="n">adapters</span> <span class="n">detected</span><span class="p">:</span> <span class="mi">2</span> <span class="n">rescanned</span><span class="p">,</span> <span class="mi">0</span> <span class="n">skipped</span><span class="p">,</span> <span class="mi">0</span> <span class="n">failed</span> <span class="p">(</span><span class="mf">0.32</span><span class="n">s</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="creating-many-hosts-at-once">
<h2>Creating many hosts at once<a class="headerlink" href="#creating-many-hosts-at-once" title="Permalink to this heading"></a></h2>
<p>Many hosts can be added at once using
<code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">orch</span> <span class="pre">apply</span> <span class="pre">-i</span></code> by submitting a multi-document YAML file:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">service_type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">host</span>
<span class="nt">hostname</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">node-00</span>
<span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.0.10</span>
<span class="nt">labels</span><span class="p">:</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example1</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example2</span>
<span class="nn">---</span>
<span class="nt">service_type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">host</span>
<span class="nt">hostname</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">node-01</span>
<span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.0.11</span>
<span class="nt">labels</span><span class="p">:</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">grafana</span>
<span class="nn">---</span>
<span class="nt">service_type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">host</span>
<span class="nt">hostname</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">node-02</span>
<span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.0.12</span>
</pre></div>
</div>
<p>This can be combined with <a class="reference internal" href="../services/#orchestrator-cli-service-spec"><span class="std std-ref">service specifications</span></a>
to create a cluster spec file to deploy a whole cluster in one command.  see
<code class="docutils literal notranslate"><span class="pre">cephadm</span> <span class="pre">bootstrap</span> <span class="pre">--apply-spec</span></code> also to do this during bootstrap. Cluster
SSH Keys must be copied to hosts prior to adding them.</p>
</section>
<section id="setting-the-initial-crush-location-of-host">
<h2>Setting the initial CRUSH location of host<a class="headerlink" href="#setting-the-initial-crush-location-of-host" title="Permalink to this heading"></a></h2>
<p>Hosts can contain a <code class="docutils literal notranslate"><span class="pre">location</span></code> identifier which will instruct cephadm to
create a new CRUSH host bucket located in the specified hierarchy.
You can specify more than one element of the tree when doing so (for
instance if you want to ensure that the rack that a host is being
added to is also added to the default bucket), for example:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">service_type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">host</span>
<span class="nt">hostname</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">node-00</span>
<span class="nt">addr</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">192.168.0.10</span>
<span class="nt">location</span><span class="p">:</span>
<span class="w">  </span><span class="nt">root</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">default</span>
<span class="w">  </span><span class="nt">rack</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">rack1</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The <code class="docutils literal notranslate"><span class="pre">location</span></code> attribute will affect only the initial CRUSH location.
Subsequent changes to the <code class="docutils literal notranslate"><span class="pre">location</span></code> property will be ignored.
Removing a host will not remove an associated CRUSH bucket unless the
<code class="docutils literal notranslate"><span class="pre">--rm-crush-entry</span></code> flag is provided to the <code class="docutils literal notranslate"><span class="pre">orch</span> <span class="pre">host</span> <span class="pre">rm</span></code> command.</p>
</div>
<p>See also <a class="reference internal" href="../../rados/operations/crush-map/#crush-map-default-types"><span class="std std-ref">类型和桶</span></a>.</p>
</section>
<section id="removing-a-host-from-the-crush-map">
<h2>Removing a host from the CRUSH map<a class="headerlink" href="#removing-a-host-from-the-crush-map" title="Permalink to this heading"></a></h2>
<p>The <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">orch</span> <span class="pre">host</span> <span class="pre">rm</span></code> command has support for removing the associated host bucket
from the CRUSH map. This is done by providing the <code class="docutils literal notranslate"><span class="pre">--rm-crush-entry</span></code> flag.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><style type="text/css">
span.prompt3:before {
  content: "[ceph:root@host1/]# ";
}
</style><span class="prompt3">ceph<span class="w"> </span>orch<span class="w"> </span>host<span class="w"> </span>rm<span class="w"> </span>host1<span class="w"> </span>--rm-crush-entry</span>
</pre></div></div><p>When this flag is specified, cephadm will attempt to remove the host bucket
from the CRUSH map as part of the host removal process. Note that if
it fails to do so, cephadm will report the failure and the host will remain under
cephadm control.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Removal from the CRUSH map will fail if there are OSDs deployed on the
host. If you would like to remove all the host’s OSDs as well, please start
by using  the <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">orch</span> <span class="pre">host</span> <span class="pre">drain</span></code> command to do so. Once the OSDs
have been removed, then you may direct cephadm remove the CRUSH bucket
along with the host using the <code class="docutils literal notranslate"><span class="pre">--rm-crush-entry</span></code> flag.</p>
</div>
</section>
<section id="os-tuning-profiles">
<h2>OS Tuning Profiles<a class="headerlink" href="#os-tuning-profiles" title="Permalink to this heading"></a></h2>
<p>Cephadm can be used to manage operating system tuning profiles that apply
<code class="docutils literal notranslate"><span class="pre">sysctl</span></code> settings to sets of hosts.</p>
<p>To do so, create a YAML spec file in the following format:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">profile_name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">23-mon-host-profile</span>
<span class="nt">placement</span><span class="p">:</span>
<span class="w">  </span><span class="nt">hosts</span><span class="p">:</span>
<span class="w">    </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">mon-host-01</span>
<span class="w">    </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">mon-host-02</span>
<span class="nt">settings</span><span class="p">:</span>
<span class="w">  </span><span class="nt">fs.file-max</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1000000</span>
<span class="w">  </span><span class="nt">vm.swappiness</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;13&#39;</span>
</pre></div>
</div>
<p>Apply the tuning profile with the following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>tuned-profile<span class="w"> </span>apply<span class="w"> </span>-i<span class="w"> </span>&lt;tuned-profile-file-name&gt;</span>
</pre></div></div><p>This profile is written to a file under <code class="docutils literal notranslate"><span class="pre">/etc/sysctl.d/</span></code> on each host
specified in the <code class="docutils literal notranslate"><span class="pre">placement</span></code> block, then <code class="docutils literal notranslate"><span class="pre">sysctl</span> <span class="pre">--system</span></code> is
run on the host.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The exact filename that the profile is written to within <code class="docutils literal notranslate"><span class="pre">/etc/sysctl.d/</span></code>
is <code class="docutils literal notranslate"><span class="pre">&lt;profile-name&gt;-cephadm-tuned-profile.conf</span></code>, where <code class="docutils literal notranslate"><span class="pre">&lt;profile-name&gt;</span></code> is
the <code class="docutils literal notranslate"><span class="pre">profile_name</span></code> setting that you specify in the YAML spec. We suggest
naming these profiles following the usual <code class="docutils literal notranslate"><span class="pre">sysctl.d</span></code> <cite>NN-xxxxx</cite> convention. Because
sysctl settings are applied in lexicographical order (sorted by the filename
in which the setting is specified), you may want to carefully choose
the <code class="docutils literal notranslate"><span class="pre">profile_name</span></code> in your spec so that it is applied before or after other
conf files.  Careful selection ensures that values supplied here override or
do not override those in other <code class="docutils literal notranslate"><span class="pre">sysctl.d</span></code> files as desired.</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>These settings are applied only at the host level, and are not specific
to any particular daemon or container.</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Applying tuning profiles is idempotent when the <code class="docutils literal notranslate"><span class="pre">--no-overwrite</span></code> option is
passed. Moreover, if the <code class="docutils literal notranslate"><span class="pre">--no-overwrite</span></code> option is passed, existing
profiles with the same name are not overwritten.</p>
</div>
<section id="viewing-profiles">
<h3>Viewing Profiles<a class="headerlink" href="#viewing-profiles" title="Permalink to this heading"></a></h3>
<p>Run the following command to view all the profiles that cephadm currently manages:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>tuned-profile<span class="w"> </span>ls</span>
</pre></div></div><div class="admonition note">
<p class="admonition-title">Note</p>
<p>To make modifications and re-apply a profile, pass <code class="docutils literal notranslate"><span class="pre">--format</span> <span class="pre">yaml</span></code> to the
<code class="docutils literal notranslate"><span class="pre">tuned-profile</span> <span class="pre">ls</span></code> command. The <code class="docutils literal notranslate"><span class="pre">tuned-profile</span> <span class="pre">ls</span> <span class="pre">--format</span> <span class="pre">yaml</span></code> command
presents the profiles in a format that is easy to copy and re-apply.</p>
</div>
</section>
<section id="removing-profiles">
<h3>Removing Profiles<a class="headerlink" href="#removing-profiles" title="Permalink to this heading"></a></h3>
<p>To remove a previously applied profile, run this command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>tuned-profile<span class="w"> </span>rm<span class="w"> </span>&lt;profile-name&gt;</span>
</pre></div></div><p>When a profile is removed, cephadm cleans up the file previously written to <code class="docutils literal notranslate"><span class="pre">/etc/sysctl.d</span></code>.</p>
</section>
<section id="modifying-profiles">
<h3>Modifying Profiles<a class="headerlink" href="#modifying-profiles" title="Permalink to this heading"></a></h3>
<p>Profiles can be modified by re-applying a YAML spec with the same name as the
profile that you want to modify, but settings within existing profiles can be
adjusted with the following commands.</p>
<p>To add or modify a setting in an existing profile:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>tuned-profile<span class="w"> </span>add-setting<span class="w"> </span>&lt;profile-name&gt;<span class="w"> </span>&lt;setting-name&gt;<span class="w"> </span>&lt;value&gt;</span>
</pre></div></div><p>To remove a setting from an existing profile:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>orch<span class="w"> </span>tuned-profile<span class="w"> </span>rm-setting<span class="w"> </span>&lt;profile-name&gt;<span class="w"> </span>&lt;setting-name&gt;</span>
</pre></div></div><div class="admonition note">
<p class="admonition-title">Note</p>
<p>Modifying the placement requires re-applying a profile with the same name.
Remember that profiles are tracked by their names, so when a profile with the
same name as an existing profile is applied, it overwrites the old profile
unless the <code class="docutils literal notranslate"><span class="pre">--no-overwrite</span></code> flag is passed.</p>
</div>
</section>
</section>
<section id="ssh-configuration">
<h2>SSH Configuration<a class="headerlink" href="#ssh-configuration" title="Permalink to this heading"></a></h2>
<p>Cephadm uses SSH to connect to remote hosts.  SSH uses a key to authenticate
with those hosts in a secure way.</p>
<section id="default-behavior">
<h3>Default behavior<a class="headerlink" href="#default-behavior" title="Permalink to this heading"></a></h3>
<p>Cephadm stores an SSH key in the monitor that is used to
connect to remote hosts.  When the cluster is bootstrapped, this SSH
key is generated automatically and no additional configuration
is necessary.</p>
<p>A <em>new</em> SSH key can be generated with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>cephadm<span class="w"> </span>generate-key</span>
</pre></div></div><p>The public portion of the SSH key can be retrieved with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>cephadm<span class="w"> </span>get-pub-key</span>
</pre></div></div><p>The currently stored SSH key can be deleted with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>cephadm<span class="w"> </span>clear-key</span>
</pre></div></div><p>You can make use of an existing key by directly importing it with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config-key<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr/cephadm/ssh_identity_key<span class="w"> </span>-i<span class="w"> </span>&lt;key&gt;</span>
<span class="prompt1">ceph<span class="w"> </span>config-key<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr/cephadm/ssh_identity_pub<span class="w"> </span>-i<span class="w"> </span>&lt;pub&gt;</span>
</pre></div></div><p>You will then need to restart the mgr daemon to reload the configuration with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>mgr<span class="w"> </span>fail</span>
</pre></div></div></section>
<section id="configuring-a-different-ssh-user">
<span id="cephadm-ssh-user"></span><h3>Configuring a different SSH user<a class="headerlink" href="#configuring-a-different-ssh-user" title="Permalink to this heading"></a></h3>
<p>Cephadm must be able to log into all the Ceph cluster nodes as an user
that has enough privileges to download container images, start containers
and execute commands without prompting for a password. If you do not want
to use the “root” user (default option in cephadm), you must provide
cephadm the name of the user that is going to be used to perform all the
cephadm operations. Use the command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>cephadm<span class="w"> </span>set-user<span class="w"> </span>&lt;user&gt;</span>
</pre></div></div><p>Prior to running this the cluster SSH key needs to be added to this users
authorized_keys file and non-root users must have passwordless sudo access.</p>
</section>
<section id="customizing-the-ssh-configuration">
<h3>Customizing the SSH configuration<a class="headerlink" href="#customizing-the-ssh-configuration" title="Permalink to this heading"></a></h3>
<p>Cephadm generates an appropriate <code class="docutils literal notranslate"><span class="pre">ssh_config</span></code> file that is
used for connecting to remote hosts.  This configuration looks
something like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Host</span> <span class="o">*</span>
<span class="n">User</span> <span class="n">root</span>
<span class="n">StrictHostKeyChecking</span> <span class="n">no</span>
<span class="n">UserKnownHostsFile</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">null</span>
</pre></div>
</div>
<p>There are two ways to customize this configuration for your environment:</p>
<ol class="arabic">
<li><p>Import a customized configuration file that will be stored
by the monitor with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>cephadm<span class="w"> </span>set-ssh-config<span class="w"> </span>-i<span class="w"> </span>&lt;ssh_config_file&gt;</span>
</pre></div></div><p>To remove a customized SSH config and revert back to the default behavior:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>cephadm<span class="w"> </span>clear-ssh-config</span>
</pre></div></div></li>
<li><p>You can configure a file location for the SSH configuration file with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/cephadm/ssh_config_file<span class="w"> </span>&lt;path&gt;</span>
</pre></div></div><p>We do <em>not recommend</em> this approach.  The path name must be
visible to <em>any</em> mgr daemon, and cephadm runs all daemons as
containers. That means that the file must either be placed
inside a customized container image for your deployment, or
manually distributed to the mgr data directory
(<code class="docutils literal notranslate"><span class="pre">/var/lib/ceph/&lt;cluster-fsid&gt;/mgr.&lt;id&gt;</span></code> on the host, visible at
<code class="docutils literal notranslate"><span class="pre">/var/lib/ceph/mgr/ceph-&lt;id&gt;</span></code> from inside the container).</p>
</li>
</ol>
</section>
<section id="setting-up-ca-signed-keys-for-the-cluster">
<h3>Setting up CA signed keys for the cluster<a class="headerlink" href="#setting-up-ca-signed-keys-for-the-cluster" title="Permalink to this heading"></a></h3>
<p>Cephadm also supports using CA signed keys for SSH authentication
across cluster nodes. In this setup, instead of needing a private
key and public key, we instead need a private key and certificate
created by signing that private key with a CA key. For more info
on setting up nodes for authentication using a CA signed key, see
<a class="reference internal" href="../install/#cephadm-bootstrap-ca-signed-keys"><span class="std std-ref">Deployment with CA signed SSH keys</span></a>. Once you have your private
key and signed cert, they can be set up for cephadm to use by running:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config-key<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr/cephadm/ssh_identity_key<span class="w"> </span>-i<span class="w"> </span>&lt;private-key-file&gt;</span>
<span class="prompt1">ceph<span class="w"> </span>config-key<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr/cephadm/ssh_identity_cert<span class="w"> </span>-i<span class="w"> </span>&lt;signed-cert-file&gt;</span>
</pre></div></div></section>
</section>
<section id="fully-qualified-domain-names-vs-bare-host-names">
<span id="cephadm-fqdn"></span><h2>Fully qualified domain names vs bare host names<a class="headerlink" href="#fully-qualified-domain-names-vs-bare-host-names" title="Permalink to this heading"></a></h2>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>cephadm demands that the name of the host given via <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">orch</span> <span class="pre">host</span> <span class="pre">add</span></code>
equals the output of <code class="docutils literal notranslate"><span class="pre">hostname</span></code> on remote hosts.</p>
</div>
<p>Otherwise cephadm can’t be sure that names returned by
<code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">*</span> <span class="pre">metadata</span></code> match the hosts known to cephadm. This might result
in a <a class="reference internal" href="../operations/#cephadm-stray-host"><span class="std std-ref">CEPHADM_STRAY_HOST</span></a> warning.</p>
<p>When configuring new hosts, there are two <strong>valid</strong> ways to set the
<code class="docutils literal notranslate"><span class="pre">hostname</span></code> of a host:</p>
<ol class="arabic simple">
<li><p>Using the bare host name. In this case:</p></li>
</ol>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">hostname</span></code> returns the bare host name.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">hostname</span> <span class="pre">-f</span></code> returns the FQDN.</p></li>
</ul>
<ol class="arabic simple" start="2">
<li><p>Using the fully qualified domain name as the host name. In this case:</p></li>
</ol>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">hostname</span></code> returns the FQDN</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">hostname</span> <span class="pre">-s</span></code> return the bare host name</p></li>
</ul>
<p>Note that <code class="docutils literal notranslate"><span class="pre">man</span> <span class="pre">hostname</span></code> recommends <code class="docutils literal notranslate"><span class="pre">hostname</span></code> to return the bare
host name:</p>
<blockquote>
<div><p>The FQDN (Fully Qualified Domain Name) of the system is the
name that the resolver(3) returns for the host name, for example
<code class="docutils literal notranslate"><span class="pre">ursula.example.com</span></code>. It is usually the short hostname followed by the DNS
domain name (the part after the first dot). You can check the FQDN
using <code class="docutils literal notranslate"><span class="pre">hostname</span> <span class="pre">--fqdn</span></code> or the domain name using <code class="docutils literal notranslate"><span class="pre">dnsdomainname</span></code>.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>You cannot change the FQDN with hostname or dnsdomainname.

The recommended method of setting the FQDN is to make the hostname
be an alias for the fully qualified name using /etc/hosts, DNS, or
NIS. For example, if the hostname was &quot;ursula&quot;, one might have
a line in /etc/hosts which reads

       127.0.1.1    ursula.example.com ursula
</pre></div>
</div>
</div></blockquote>
<p>Which means, <code class="docutils literal notranslate"><span class="pre">man</span> <span class="pre">hostname</span></code> recommends <code class="docutils literal notranslate"><span class="pre">hostname</span></code> to return the bare
host name. This in turn means that Ceph will return the bare host names
when executing <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">*</span> <span class="pre">metadata</span></code>. This in turn means cephadm also
requires the bare host name when adding a host to the cluster:
<code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">orch</span> <span class="pre">host</span> <span class="pre">add</span> <span class="pre">&lt;bare-name&gt;</span></code>.</p>
</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../adoption/" class="btn btn-neutral float-left" title="现有集群切换到 cephadm" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../services/" class="btn btn-neutral float-right" title="Service Management" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>